//var mongoose = require('mongoose')
function ChoicesModel(mongoose) {  //选择题
    const ChoiceSchema = new mongoose.Schema({
      title: {//题目
        text:{type: 'string'},
        pic:{type: 'string'}
      },  
      choices: {  //选项
        cho1:{type: 'string'}, 
        cho2:{type: 'string'},
        cho3:{type: 'string'},
        cho4:{type: 'string'},
      },
      answer: { type: 'string' },   //答案
      analysis: { type: 'string' },  //解析
      propety: { type: 'string' }, //所属章节知识点
    });

    const ChoicesModel = mongoose.model('ChoicesModel',ChoiceSchema);
    return ChoicesModel;
  }

function blankModel() {//填空题
    const blankSchema = new mongoose.Schema({ 
      title: { type: 'string' },
      answer: { type: 'string' },
      analysis: { type: 'string' }, 
      propety: { type: 'string' }, //属性 所属章节知识点
    });

    const blankModel = mongoose.model('blankModel',blankSchema);
    return blankModel;
  }

  function drawModel() { //画图题
    const drawSchema = new mongoose.Schema({
      title: { type: 'string' },
      answer: { type: 'string' },
      analysis: { type: 'string' }, 
      propety: { type: 'string' }, //所属章节知识点
    });

    const drawModel = mongoose.model('drawModel',drawSchema);
    return drawModel;
  }

  module.exports = {
    ChoicesModel,
    blankModel,
    drawModel
  };